$(function(){
	$(window).resize(function(){
		resize();
	});
	$(window).load(function(){
		resize();
	});
	//列表在指定区域自动出现滚动条、隔行换色、光标接触背景变色
	$(".list").wrapAll("<div class='list_wrap'></div>");
	$(".list tr:even").addClass("even");
	$(".list tr").each(function(){
		var class_name = this.className;
		$(this).hover(function(){
			this.className = "over";		 
		},function(){
			this.className = class_name;
		});
	});
	var resize = function(){
		var h = new Array();
		h[0] = $("body").height();
		h[2] = $(".page").outerHeight(true);
		if(!$(".list").length == 0){
			var list_offset = $(".list_wrap").offset().top;
			$(".list_wrap").height(h[0] - list_offset - h[2]);
		};
		if($(".list_wrap").height() < $(".list").height()){
			$(".list_wrap").css({"border-right":"1px solid #bad7d2","border-bottom":"1px solid #bad7d2"});
		}else{
			$(".list_wrap").css({"border-right":"none","border-bottom":"none"});
		};
		if(!$(".tree_tab").length == 0){
			var td_offset = $(".tree_tab td:first").offset().top;
			$(".tree_tab td:first").height(h[0] - td_offset);
		};
	};
	resize();
	//按钮的光标响应效果
	$("input:button").hover(function(){
		var className = this.className;
		$(this).removeClass().addClass(className + "_over")
	},function(){
		var className = this.className;
		var className_off = this.className.substring(0,5);
		$(this).removeClass(className).addClass(className_off)
	});
	//输入框的光标响应效果
	//$(":text,textarea").addClass("form_off");
	//$(":text,textarea").wrap("<span class='c_bor'></span>");
	//$(":text,textarea").focus(function(){
	//	this.className = "form_on";					 					   
	//});
	//$(":text,textarea").blur(function(){
	//	this.className = "form_off";					 					   
	//});
	$(".page input").css({"height":"15px","line-height":"15px","text-align":"center"});
	//排序图片的光标响应效果
	$(".list th img").hover(function(){
		var src = $(this).attr("src");
		if(src == "../images/arrow_up.gif"){
			$(this).attr({"src":"../images/arrow_upover.gif"});
		}else if(src == "../images/arrow_down.gif"){
			$(this).attr({"src":"../images/arrow_downover.gif"});
		}
	},function(){
		var src = $(this).attr("src");
		if(src == "../images/arrow_upover.gif"){
			$(this).attr({"src":"../images/arrow_up.gif"});
		}else if(src == "../images/arrow_downover.gif"){
			$(this).attr({"src":"../images/arrow_down.gif"});
		};
	});
	$(".list th img").click(function(){
		var src = $(this).attr("src");
		if(src == "../images/arrow_upover.gif"){
			$("th span img:even").attr({"src":"../images/arrow_up.gif"});
			$("th span img:odd").attr({"src":"../images/arrow_down.gif"});
			$(this).attr("src","../images/arrow_upon.gif");
		}else if(src == "../images/arrow_downover.gif"){
			$("th span img:even").attr({"src":"../images/arrow_up.gif"});
			$("th span img:odd").attr({"src":"../images/arrow_down.gif"});
			$(this).attr("src","../images/arrow_downon.gif");
		};
	});
	$(".new tr td:even").css({"background":"#ebfaff","text-align":"right"});
	$(":text,textarea,password").css({"border":"1px solid #7e9db8","margin-left":"5px","padding":"4px"});
	
})